<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="moil">
<head>
    <%@include file="/WEB-INF/jsp/commons/meta.jsp" %>
    <title>${title}</title>
    <meta charset="utf-8">
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <!-- 响应式设计 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>
<body ng-controller="AllDocCtrl">
<!-- content -->
<div class="u_child_box">
    <div class="u_title_bar">
        <span id="device_info" class="u_title">部门类型编辑</span>
    </div>
</div>
<form id="inputForm" class="well form-inline" action="${ctx}/security/departmentType/save" method="post">
    <input type="hidden" name="id" value="${departmentType.id}"/>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
        <strong>
            <i class="icon-flag"></i>
            部门类型表单
        </strong>
        </thead>
        <tr>
            <td class="span2">类型名称:</td>
            <td>
                <input id="name" name="name" type="text" value="${departmentType.name}" size="30" maxlength="80"/>
            </td>
        </tr>
        <tr>
            <td>备注:</td>
            <td>
                <textarea id="memo" name="memo" rows="4" class="span6">${departmentType.memo}</textarea>
            </td>
        </tr>

        <tr>
            <td></td>
            <td>
                <input class="btn" type="submit" value="提交"/>
                &nbsp;
                <input class="btn" type="button" value="返回" onclick="history.back()"/>
            </td>
        </tr>
    </table>
</form>
<script>
    (function () {
        angular.module("moil", []);
        window.AllDocCtrl = function ($scope, $rootScope) {

        }
    })();
    $(document).ready(function () {
        //聚焦第一个输入框
        $("#name").focus();
        //为inputForm注册validate函数
        $("#inputForm").validate({
            rules: {
                name: "required",
                type: "required"
            }
        });
        //多选框
        $("label[id^='group']").click(function () {
            var _self = $(this);
            var checked = $(":checkbox", _self).attr("checked");
            var id = _self.attr("id");
            var items = $("[for='" + id + "'] :checkbox");
            if (checked) {
                items.attr("checked", "checked");
            } else {
                items.removeAttr("checked");
            }
        });
    });
</script>
</body>
</html>